Makefile refactor.
Some refactor + started test for output