tests for directory existing before deleting NTA and BUILDDIR. adds creation of intermediate directories, if any, for BUILDDIR