On line 27, the CONFIGURE_NETCDFF_LIB needs to be placed before -lnetcdf
NETCDFLIB = -L${NETCDF}/lib -lnetcdf CONFIGURE_NETCDFF_LIB
It should be
NETCDFLIB = -L${NETCDF}/lib CONFIGURE_NETCDFF_LIB -lnetcdf
The order of -lnetcdff -lnetcdf is important, at least when compiling using gfortran.