Ditched makefile integration. Lots of bug fixes.

Ditched makefile integration because of compilation failures (for the
time being). Lots and lots of bug fixes.