Made Makefile more cross-platform

This allows easy compiling on Mac OS X, and allows specifying custom CFLAGS, LDFLAGS, and PREFIX.