Add patch helper targets (close gh-14).
Remove patch for perlglob.c tentatively because it fails perl compilation.
Adjust newline codes and encoding.