Add mkspec_try_flags function to check for available compiler flags