Fix FreeBSD build errors
merge from STJr/SRB2!2071 (merged) and STJr/SRB2!2179 (merged), additionally fixing a few other build problems related to Kart on FreeBSD.
merge from STJr/SRB2!2071 (merged) and STJr/SRB2!2179 (merged), additionally fixing a few other build problems related to Kart on FreeBSD.