small build system improvements

Would make it easier to package this in source distros.