Mangle names correctly when included from C++

C++ compilers require headers for C libraries to be wrapped in extern
"C" to prevent name mangling. This changeset fixes this when the
header is included from C++.
doc: Fix Doxygen feature selection and integration

The Doxygen autoconf macros require feature selection to be done
before calling DX_INIT_DOXYGEN. This changeset fixes that and adds the
Doxygen output to the MOSTLYCLEANFILES variable.
Update gitignore