Add a Makefile; allow compiling on OS X.

OS X requires <unistd.h> for the declarations of sleep() and usleep(),
and also requires libc++ instead of libstdc++.

Add -W -Wall and remove a few unused variables.