Compatibility fix for newer autoutils.

This patch fixes the build for modern versions of autotools. AM_CONFIG_HEADER has been deprecated for years and autotools 1.13 removes this macros at all. The message is:

configure.ac:15: error: 'AM_CONFIG_HEADER': this macro is obsolete.
    You should use the 'AC_CONFIG_HEADERS' macro instead.

Also AC_CONFIG_MACRO_DIR has been deleted because there is not m4 folder included in distro. This causes an error:

aclocal-1.13: error: couldn't open directory 'm4': No such file or directory

Testing:
1. Builds on gentoo.
2. Builds on RHEL 6.4.