configure: misc tweaks to be more cross compiler friendly.