I've committed a Makefile which works on (at least) Mac OS X, Linux, FreeBSD, NetBSD and Solaris.

For the *BSDs and Solaris, it won't work if GNU make is used. However, this is no worse than it was before I messed with it to get it to work under Solaris.