Add contrib/relative_path.sh to calculate relative paths using only bash

Rename LIBDIR_REL to $(libdir_REL), to better match $(libdir)