configure: simplify some OS-specific flag setting