Replace fetchgit with fetchFromGitHub now that it supports fetching submodules. Remove unnecessary postPatch to add <math.h> as termite already includes <cmath>. Add a patch to include <errno.h> on all platforms and remove the --as-needed flag from ld on macOS.