fix building problems when configure not run inside source tree