Welcome to forum!
Do you have exec permission on partition? Following command will give the answer:
For example my /tmp is as follows (look for noexec):
/dev/sda3 on /tmp type ext3 (rw,noexec,nosuid,nodev)
Also make sure you have complete gcc and development environment installed