Been a while since I've used GLUT, but if I recall correctly you need to compile with the following options:
gcc -lGL -lGLU your_source_code.c
Also, be sure to include:
#include <GL/glu.h>
#include <GL/glut.h>
in your source code.
But a word of advice - GLUT sucks. I spent countless hours learning it only to find out it's extraordinarily limited and effectively useless for any real programming. If I had it to do over agin, I would have spent my time learning a GL interface that is practical in real-world apps.
wxWidgets has one, and there are plenty of others if you look around a bit. Good luck!