Fix makefile and do some cleanup.