In 2025 libtinfo-dev is listed as a transitional package on ubuntu 22.04 for libncurses-dev. After installing the latter, the linking error went away in my case on ubuntu 24.04.
libtinfo-dev
libncurses-dev