modify scripts so things build on debian, too

This series enables me to get things building on a Debian Wheezy system.  Not all the patches in the series are strictly necessary for building on Debian, but they are useful nonetheless and I hope that you won't mind that I included them.

I suppose the documentation and comments in several places should also be updated.  I can do that in a followup pull request or another commit stacked on top of this series.  Let me know what you prefer.