Source tree and compile options refactoring

Hi all,

I am proposing to use a bit more the Makefiles to tune and build the software, rather than relying on dummy files and pure compile options.
Looking forward to get feedback.

Cheers,
Hoel