Update the makefile
Refactored code so it compiles and run on Mac