Fix lack of return and implicit tolower(), clean up Makefile