Applied Philipp Hachtmann's Makefile and other misc. changes patches.