I checked with nm and there were some fucntions/subroutines with two udnerscores. Even though makefile had fno-second-underscore in it. Anyways, I did some changes in makefile for libmeam and for LAMMPS and it is working now. I finally was able to compile LAMMPS with meam package. thanks for your help.
For anyone, who is having similar issues, here are my two makefiles.
Makefile for libmeam.a (Makefile.gfortran)