build: replace hand rolled code with CustomTarget[Index].links_dynamically()
build: replace hand rolled code with CustomTarget[Index].links_dynamically()

Which also fixes builds on windows that might produce a .lib instead of
a .a. The error message has been changed to reflect that as well

pexip/meson,pexip/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson,pexip/meson,pexip/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,pexip/meson,pexip/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson