Make configure.ac palatable to FreeBSD 9.1

This fixes the broken IPv6 stuff so much that configure will run.
The resulting makefile does not build at all.

A royal mess.