fix: LTO warning of gcc >= 11.4 (#5791)

lto-wrapper: warning: using serial compilation of n LTRANS jobs
https://stackoverflow.com/questions/72218980/gcc-v12-1-warning-about-serial-compilation
diff --git a/tools/pybind11Common.cmake b/tools/pybind11Common.cmake
index 7ca700f..1c1d4f8 100644
--- a/tools/pybind11Common.cmake
+++ b/tools/pybind11Common.cmake
@@ -364,6 +364,11 @@
     endif()
     if(NOT HAS_FLTO_THIN)
       _pybind11_return_if_cxx_and_linker_flags_work(
+        HAS_FLTO_AUTO "-flto=auto${cxx_append}" "-flto=auto${linker_append}"
+        PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)
+    endif()
+    if(NOT HAS_FLTO_AUTO)
+      _pybind11_return_if_cxx_and_linker_flags_work(
         HAS_FLTO "-flto${cxx_append}" "-flto${linker_append}" PYBIND11_LTO_CXX_FLAGS
         PYBIND11_LTO_LINKER_FLAGS)
     endif()