cmake convenience
cmake: fix lto build
fix build with recent mingw-w64