Which library are you using ?

When your code is linked with different libraries,  you can retrieve the path library of a given routine by using the -Wl ,-y option.
For example:
with Cray and linking a code with Libsci, here is the output:

ftn -o test test_scalapack.f90 -Wl,-ydgemm_
/opt/cray/libsci/13.2.0/CRAY/8.3/x86_64/lib/libsci_cray_mpi_mp.a(PB_Cdtypeset.o): reference to dgemm_
/opt/cray/libsci/13.2.0/CRAY/8.3/x86_64/lib/libsci_cray_mp.a(dgemm_.o): definition of dgemm_

with Intel and MKL ( after unloading libsci)

ftn -o exe_dgemm_mkl timing_dgemm.f90 -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm -Wl,-ydgemm_
/tmp/ifortu3oFZN.o: reference to dgemm_
/opt/intel/composer_xe_2015.2.164/mkl/lib/intel64/libmkl_intel_lp64.a(_dgemm_lp64.o): definition of dgemm_