CMake 3.22.1 does not correctly interpret the conditional generator expression inside target_link_libraries when the library list is multiline. I could have put everything on one line but I preferred to treat the list externally to be able to manage it better.
Updated the README with instructions to successfully compile with Ubuntu.