Makefile fixes

This fixes #44 and also separates out the cflag and libs argument for g++. This fixes a problem with the examples not compiling (or rather, not linking)