Changed makefile and fixed a bug in the c program