I just downloaded the source code for the 'fog' example, and all it has is a Makefile as way to build it.
Anyway, I created a new empty project in Code::Blocks, decompressed the zip file in the same folder as the project, added all source files to the project, added 'glut' to the link libraries (as seen in the Makefile), hit build, and it failed because it could not find gluPerspective. Same story if I use the Makefile. To solve that specific issue, I just Googled and found that GLU needs to be added too. I added GLU to the linker libraries and that was it. It builds and runs.
Just in case, I did that in Linux.