You hit the nail on the head! I was initially using Stan 2.23, moving to 2.27 allows me to build with no errors. Some warnings were produced (see below), but an executable is produced and runs. Thank you for the help!
--- Compiling, linking C++ code ---
g++ -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DBOOST_DISABLE_ASSERTS -c -Wno-ignored-attributes -x c++ -o ../src/models/deaths_and_111_calls.o ../src/models/deaths_and_111_calls.hpp
g++ -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DBOOST_DISABLE_ASSERTS -Wl,-L,"/users/mjcarter/covid-19-uk/cmdstan-2.27.0/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/users/mjcarter/covid-19-uk/cmdstan-2.27.0/stan/lib/stan_math/lib/tbb" ../src/models/deaths_and_111_calls.o src/cmdstan/main.o -Wl,-L,"/users/mjcarter/covid-19-uk/cmdstan-2.27.0/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/users/mjcarter/covid-19-uk/cmdstan-2.27.0/stan/lib/stan_math/lib/tbb" stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_cvodes.a stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_idas.a stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_kinsol.a stan/lib/stan_math/lib/tbb/libtbb.so.2 -o ../src/models/deaths_and_111_calls
/usr/bin/ld: ../src/models/deaths_and_111_calls.o: In function `double boost::math::detail::digamma_imp<double, boost::integral_constant<int, 53>, boost::math::policies::policy<boost::math::policies::pole_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::overflow_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >(double, boost::integral_constant<int, 53> const*, boost::math::policies::policy<boost::math::policies::pole_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::overflow_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> const&) [clone .constprop.1946]':
deaths_and_111_calls.hpp:(.text+0x22a4): toc optimization is not supported for 0xe5890002 instruction.
/usr/bin/ld: deaths_and_111_calls.hpp:(.text+0x22b4): toc optimization is not supported for 0xe5a90002 instruction.
/usr/bin/ld: deaths_and_111_calls.hpp:(.text+0x22c8): toc optimization is not supported for 0xe4290002 instruction.
/usr/bin/ld: deaths_and_111_calls.hpp:(.text+0x22e0): toc optimization is not supported for 0xe4090002 instruction.
/usr/bin/ld: ../src/models/deaths_and_111_calls.o: In function `double boost::math::detail::gamma_imp<double, boost::math::policies::policy<boost::math::policies::pole_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::overflow_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>, boost::math::lanczos::lanczos13m53>(double, boost::math::policies::policy<boost::math::policies::pole_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::overflow_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> const&, boost::math::lanczos::lanczos13m53 const&)':
deaths_and_111_calls.hpp:(.text._ZN5boost4math6detail9gamma_impIdNS0_8policies6policyINS3_10pole_errorILNS3_17error_policy_typeE1EEENS3_14overflow_errorILS6_1EEENS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyESE_SE_SE_SE_SE_SE_SE_SE_EENS0_7lanczos12lanczos13m53EEET_SI_RKT0_RKT1_[_ZN5boost4math6detail9gamma_impIdNS0_8policies6policyINS3_10pole_errorILNS3_17error_policy_typeE1EEENS3_14overflow_errorILS6_1EEENS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyESE_SE_SE_SE_SE_SE_SE_SE_EENS0_7lanczos12lanczos13m53EEET_SI_RKT0_RKT1_]+0x94): toc optimization is not supported for 0xe7e90002 instruction.
/usr/bin/ld: ../src/models/deaths_and_111_calls.o: In function `double boost::math::detail::lgamma_imp<double, boost::math::policies::policy<boost::math::policies::pole_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::overflow_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>, boost::math::lanczos::lanczos13m53>(double, boost::math::policies::policy<boost::math::policies::pole_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::overflow_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> const&, boost::math::lanczos::lanczos13m53 const&, int*)':
deaths_and_111_calls.hpp:(.text._ZN5boost4math6detail10lgamma_impIdNS0_8policies6policyINS3_10pole_errorILNS3_17error_policy_typeE1EEENS3_14overflow_errorILS6_1EEENS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyESE_SE_SE_SE_SE_SE_SE_SE_EENS0_7lanczos12lanczos13m53EEET_SI_RKT0_RKT1_Pi[_ZN5boost4math6detail10lgamma_impIdNS0_8policies6policyINS3_10pole_errorILNS3_17error_policy_typeE1EEENS3_14overflow_errorILS6_1EEENS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyESE_SE_SE_SE_SE_SE_SE_SE_EENS0_7lanczos12lanczos13m53EEET_SI_RKT0_RKT1_Pi]+0x3dc): toc optimization is not supported for 0xe4290002 instruction.
/usr/bin/ld: deaths_and_111_calls.hpp:(.text._ZN5boost4math6detail10lgamma_impIdNS0_8policies6policyINS3_10pole_errorILNS3_17error_policy_typeE1EEENS3_14overflow_errorILS6_1EEENS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyESE_SE_SE_SE_SE_SE_SE_SE_EENS0_7lanczos12lanczos13m53EEET_SI_RKT0_RKT1_Pi[_ZN5boost4math6detail10lgamma_impIdNS0_8policies6policyINS3_10pole_errorILNS3_17error_policy_typeE1EEENS3_14overflow_errorILS6_1EEENS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyESE_SE_SE_SE_SE_SE_SE_SE_EENS0_7lanczos12lanczos13m53EEET_SI_RKT0_RKT1_Pi]+0x3ec): toc optimization is not supported for 0xe4090002 instruction.
/usr/bin/ld: src/cmdstan/main.o: In function `boost::math::tools::promote_args<double, float, float, float, float, float>::type boost::math::digamma<double, boost::math::policies::policy<boost::math::policies::pole_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::overflow_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >(double, boost::math::policies::policy<boost::math::policies::pole_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::overflow_error<(boost::math::policies::error_policy_type)1>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> const&) [clone .isra.737]':
main.cpp:(.text.startup+0x1474): toc optimization is not supported for 0xe5890002 instruction.
/usr/bin/ld: main.cpp:(.text.startup+0x1484): toc optimization is not supported for 0xe5a90002 instruction.
/usr/bin/ld: main.cpp:(.text.startup+0x1498): toc optimization is not supported for 0xe4290002 instruction.
/usr/bin/ld: main.cpp:(.text.startup+0x14b0): toc optimization is not supported for 0xe4090002 instruction.
rm -f ../src/models/deaths_and_111_calls.o