Make the code build on 64-bit Mac OS X.

Add a Makefile for convenience.

Resolve some warnings due to missing #includes.