Can anybody suggest me a good book or web link which deals in detail with how to create Makefiles; the use of the different FLAGs in a Makefile and how to go about using them., linking of math libraries etc using bash the shell.

I would predominately be using my box with Red Hat Linux to load and use a few molecular simulation packages.