Improve source to allow compilation

Created makefile for source compilation. 
Fixed references inside cpp files.