Reworking local patches.

Rework patches to match upstream merge request. Squash the autotools
ones into one, add acinclude m4 directory.