Reorganize makefile and scripts.