Refactoring Makefile.

Trying to rework the Makefile so the build is not dependent on the order that
the files are listed. However, might cause dependency on GCC compiler.