Refactor Makefile a bit

It is still quite a mess, but hey, a least it works