Performance improvement & makefile optimization