unset BLAS_SIZE
unset BLAS_LIB
unset LAPACK_SIZE
unset LAPACK_LIB
cd $NWCHEM_TOP/src/tools
rm -rf build install
make
cd ../blas
make clean;make
cd ../lapack
make clean;make
cd ../64to32
make clean;make
cd ..
make link
Yes, this answer has solved all undefined references. Thank you very much!