On Linux, you should first compile with
gcc -g -Wall -pthread yourcode.c -lpthread -o yourprogram
-g
asks for debug information, -Wall
asks for all warnings, -pthread
asks for POSIX threads support.
when it compiles without warnings and you have debugged it with gdb
you might want the compiler to optimize by replacing (or adding after) -g
with-O2
Very soon, you'll want to make your program made of several compilation units (linked together). You then need to learn how to use a builder like GNU make and you'll have a Makefile
(don't forget that tabs are significant inside them).
Of course, you should use a version control system (I suggest to use git, perhaps thru gitorious or github) on your source code.