Fixed compilation to accomodate shadow-building properly. Also added workout for DESTDIR=IN_PWD bug for Mac.