more robust check for files and directories in make.sh