cmake: fix build failures on Debian, courtesy of Caspar