I now see the cause of the linking problem: Apache's <fnmatch.h> is shadowing the system one. Either remove Apache's bogus <fnmatch.h> or remove the code that defines SYSTEM_FNMATCH in sysdep.h.
I wonder if Apache does the fnmatch clobbering by default, or if the system integrators botch things up. If it is the former, someone should file a bug report. I sometimes wonder if anyone uses fnmatch.h, given the problems there are with using it.