Taking the linker error at its word, it means the linker is looking for a library called "libm" or "m" in other words. See this error:
Code:
/usr/bin/ld: cannot find -lm
It's looking for a library called m, but cannot find it.
Now, if it were me, I'd be suspicious initially - even though we do have such things as libc, that's a pretty short name. BUT: A google search for "libm" turns up a lot of results, for
libm.so.6 which is a Math Routines Library. Therefore, I would investigate whether or not you have this libm.so on your system somewhere (assuming that is the libm that gibbs wants) and if you do not, then find out what package it belongs to, and install that package before trying to build gibbs.
If you DO have the libm.so on your system, and it's the libm that gibbs wants, then it means there's something wrong with your linker search path, or your PKGCONFIG is messed up, or that libm is installed to a non-standard location.