If makedata.sh is failing, then everything you run after that won't work either (because the data needed isn't available or created). So, the key is to get makedata.sh running first.
I think it's possible that the problem lies with setup.pl and setdirs.sh. Could you try the following....
Run the following command :
which perl
And change the first line of setup.pl to point to that directory...
Then, try and run makedata.sh again. It may not run setdirs.sh successfully, but you can run it "manually" via
csh ./setdirs.sh
Then you should be able to run the subsequent scripts (like target-wrapper.sh and word-wrapper.sh).
I don't have a precise explanation as to why this is happening, but I was able to re-create your error and then solve it via the steps above. Give that a try and let us know how it works out...
Good luck,
Ted