Fix "make dist" tarball generation and other building fixes