Create a main Makefile and apply minor "bug" fixes

Improve the "prepare.py" script to compile the build tools,
the kernel and the system library.