First, do you compile C or C++ code?
gcc for the former, and
g++ for the latter. C++ code needs some additional linking to be performed.
Second: you have to link your program to
libpython2.7.so to embed the interpreter into it. To do this, add
-lpython2.7 to gcc command line.