fix build script for new paths & support dmd