Simplified Makefile

Added support for CFLAGS set in environment and simplified compiling
from two stages (first to .o and then to executable) to one.
SUCCESS and ERROR #defines

Now all functions return these #defined constants instead of just magic
variables. It now also frees the return of getcwd to prevent memory
leak.