Cleaning up build system
Fixing more bugs introduced in the build system
Simplified source tree by removing main.c. The code is no longer reliant on gcc -D definitions.