Just install the binary package from whatever distro you use? Why do you need to build it?
But if it matters, FreeBSD has a pretty trivial BSDmake build of it:
https://github.com/freebsd/freebsd-src/blob/main/lib/libzstd...
https://github.com/freebsd/freebsd-src/blob/main/usr.bin/zst...
You could easily do something similar in GNU make or whatever without the dependencies on the FBSD build system. It's basically just the classic "cc -c a bunch of C files, then link them."