FreeBSD build fixes

Properly use the (Threads) package to import the correct linker flags to enable threading. This was previously written but apparently uncommitted.