PostGIS raster is part of the standard postgresql- package on Debian/Ubuntu; no extra package is required. Pass N-postgis-3-DRASTER=ON to CMake:
cmake -DRASTER=ON .. make -j$(nproc) sudo make install
To include raster in the CI coverage build alongside other optional families, add -DRASTER=ON to the cmake invocation in .github/workflows/pgversion.yml.