Top hat master 6.6 wip.unix target fixes

These small commits fix TARGET=UNIX, untested on ANDROID7