Add compat.sh

* Non-POSIX niceties go here as shell functions
* pushd and popd added at this point
Simplify Makefile, add compat.sh to it