Sometimes just having the libraries installed is not enough, if you have installed them from a package ( like RPM ) you may also need the corresponding "devel" package, that includes the required "C" header files.
For instance, to run an applcation that needs libfoo, you probably need something like: libfoo-1.0.0.rpm
But to recompile the program, you might also need: libfoo-devel-1.0.0.rpm