You have an error in your Makefile:

Code:
foo.o : foo.cpp
	g++ -Wall -pedantic foo.cpp -o foo.o -lGL
should be this instead:
Code:
foo.o : foo.cpp
	g++ -Wall -pedantic -c foo.cpp -o foo.o -lGL
Dont forget gcc or g++ always tries to build a binary containing a main() entry point. The -c flag tells which ones are source files.

Also, gcc is one of the professionally made compilers with way better compiler optimizations, architecture support and many other features hardly other compilers provide

BTW I came across this topic while searching for something else, and I thought I'll register and post a reply