Reorganize and simplify Makefile