Yugabyte is best built inside of a docker container for the correct runtime environment mimicking the one the actual release is built with itself.
I found a suitable build environment by looking at the yb's CI scripts: https://github.com/yugabyte/yugabyte-db/blob/master/.github/workflows/build.yml.
Check out the source code.