In some environment, adding two options -Dblaswrap and -lI77 is required, while we do not fully understand why such a dependency exists. In such a case, add two options for CC, FC, and LIB as follows:
CC = mpicc -openmp -O3 -Dblaswrap -I/usr/local/include FC = mpif90 -mp -openmp -Dblaswrap -I/usr/local/include LIB = -L/usr/local/lib -lfftw3 -llapack -lblas -lg2c -lI77 -static