Ensured that HAVE_OPENAT is defined if openat() is available.
Ensured that AC_CONFIG_LIBOBJ_DIR is defined in configure.ac.
Removed unportable LDFLAGS settings from the Makefile.
Defined a libcompat library for implementing missing system functions.

See: http://www.gnu.org/software/automake/manual/html_node/LIBOBJS.html
Defined the openat() compatibility function.