First setup the appropriate MPI system for your account. The default is MPICH2, which should be fine for most users. Compiling MPI programs is pretty simple: just use mpicc instead of the usual C compiler.
Here is a sample Makefile.
http://cs.boisestate.edu/~amit/teaching/430/lab/Makefile.mpich2.sample