Fix order of libraries in Makefile.

The override for LDLIBS specified in the Makefile appended the
required -l flags to any previously given on the command line.  This
does not work in most cases, as additional libraries required for a
specific platform may have to be specified _after_ those explicitly
required by the project.  This change switches the order.
Avoid ELF_C_READ_MMAP specialty.

This mode is an extension of libelf from Red Hat's elfutils package.
The LGPLed libelf implementation [1] will use mmap() if available, and
either way it does not make a big difference for this use case.

[1]: http://www.mr511.de/software/english.html
Fix type warning for struct stat member st_size.

The st_size member is usually of type off_t, so add an explicit cast
to size_t for printf output.
Clean up toolchain flags.

Move preprocessor options from CFLAGS to CPPFLAGS.  Add override
directive for LDFLAGS (libcintelhex path).
Correctly handle write() return value.

Keep writing data to raw image file until all bytes have actually been
written.  Still aborts on error, with additional error message.
Add missing unistd.h include for write().
Silence some warnings found with newer GCC.

GCC 4.8 complains about some possibly uninitialized variables, which
in practice would not lead to undefined behaviour, since
symbol_map_parse() checks for errors and can only continue to use them
when all values were correctly initialized.  Explicit initializers for
these variables however don't hurt and avoid risk of undefined
behaviour.
Backup current hand-written Makefile.simple.
Add configuration for GNU automake and autoconf.
Fix compilation problems with argp.

The argp headers in current glibc define some inline functions, which
do not work well with C99's inline semantics.  Workaround by
specifying -fgnu89-inline for recent GCC versions to switch to the old
inline handling.
Add autoconf check for system API extensions.

The AC_USE_SYSTEM_EXTENSIONS macro should take care of defining
_XOPEN_SOURCE or equivalent, so remove that definition from custom
config.h.
More autoconf checks for C99, types.
Use autoconf to check for mmap().

Remove old USE_MMAP macro from config.h, replaced by standard HAVE_MMAP.
Remove old config.h header.

The only remaining compile-time configuration macro is DEBUG, which can
easily be set on the command line, or might be integrated to the
Makefile.
Update compiler flags for src directory.

Remove -std=c99 which should be set by autoconf.  Switch to -Werror as
it was supposed to be.
Clean up top-level .gitignore.

Categorize entries according to which tool generates the files and add
autotools stuff.
Ignore autom4te.cache directory.

Actually, ignore *.cache in top-level directory.
Merge branch 'autotools' into develop