Fix compilation on Mac OS X.

On the to-do list: figure out how to use automake and/or autoconf so that we
don't have to worry about manually detecting things like this.