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 and LIB as follows:
CC = gcc -O3 -Dnompi -Dnoomp -Dblaswrap LIB = -L/usr/local/lib -fftw3 -llapack -lblas -lg2c -lI77 -static
Other options, -Df77, -Df77_, -Df77__, -DF77, -DF77_, -DF77__
When lapack and blas libraries are linked, the specification of the routine name could depend on the machine environment. The variation could be capital or small letter, or with or without of the underscore. To choose a proper name of lapack and blas routines on your computational environment, you can specify an option by -Df77, -Df77_, -Df77__, -DF77, -DF77_, or -DF77__. If the capital letter is needed in calling the lapack routines, then choose 'F', and choose a type of the underscore by none, '_', or '__'. The default set is '-Df77_'.