Rewritten Makefile and restructure directory hierarchy