autogen.sh: replace custom bootstrap mechanism

autogen.sh is a widespread convention for autotools setup.
configure.ac modernization

- AM_CONFIG_HEADER->AC_CONFIG_HEADERS
  AM_CONFIG_HEADER has been deprecated for a while now,
  and completely removed from automake 1.13.
- AM_PROG_MKDIR_P->AC_PROG_MKDIR_P
  AM_PROG_MKDIR_P is deprecated.
- configure.ac: introduce AC_CONFIG_MACRO_DIR
Makefile.am: INCLUDES->AM_CPPFLAGS

INCLUDES was deprecated.