fix and clean up compile flages