Added Makefile and updated code to work with MSVC