adding a configure script with build logic taken from the old src/Makevars