Build flags optimization