Fix tool problems which prevent concurrent builds

specdep produces build rules which may go wrong during a concurrent build, and makedeb assumes it has the BUILD directory entirely to itself.   Fix these problems so we can enable concurrent builds in future.