Note the compiler option '-c' in your first step, it tells the compiler to only compile your source code and generate object file, no linking here. So compiler warned you that -lblas and -lgfortran are not used as they are for linker.
put -lblas and -lgfortran in your second step will work.