Remove useless remnants of having used autoscan to generate the build system.

Remove checks for programs that are not used, remove checks for
library headers that are not conditional, and for types, and for
functions that are not replaced.
Fix open(3) call with _FORTIFY_SOURCE.

The mode parameter is not optional when O_CREAT is passed, so pass a
default of 0644 to it.
build: use a non-recursive top-level Makefile.

This avoids entering a subdirectory as first thing, and is better
practice with autotools.
build: enable foreign automake flavour.

This allows to remove the 0-sized and autogenerated top-level
"documentation" files that are required in the default GNU flavour.
Update .gitignore file.
build: distribute README.md and COPYING.