Factoring out compilation method in the makefile.