Various build system fixes

Hello,

Here is a set of build fixes that we have accumulated against log4c-localtime in Buildroot (http://buildroot.org). It would be nice if you could integrate them, and then do a new release. This would allow us to carry less patches.

If that happens, I might as well submit a few more build system improvements, as autoconf/automake still complain about a few more things.

Thanks a lot!

Thomas