Build fixes

A few fixes to reduce warnings from autoreconf, fix "make dist", make "make distcheck" compile (but not pass, yet) and remove generated files from git.