Add some unused local variable initializations.

OS X 10.6's GCC 4.2 is, sadly, too dumb to see that these can't
actually be used uninitialized and warns about them.
Add local compat strnlen(3) implementation.

Needed on OSX < 10.7; maybe elsewhere?  (I'm putting off switching
to autoconf or something analogous.)
Replace scanf("%ms") with a fixed-size buffer.

Pre-POSIX.1-2008 systems don't support the "m" modifier, sadly.
Makefile tweaks for compatibility with earlier OSX versions.