Performance improvements & makefile optimizations