Updated makefile to support debug builds
Fixed crash when multithreading disabled (i.e. on Windows)