Add fallback for time handling on NetBSD

There's no other easy way to handle this on NetBSD, so this seems to be
the easiest solution for fixing this. Credits to @r-stu31 for this
suggestion.

Fixes #2343
Store include dirs in cflags and ldflags

This makes passing down custom options easier, since on some systems we
want to add -Wl,rpath= options for linking but they aren't supported
everywhere. Instead of having to duplicate platform detection for that
everywhere, we do it once and store in the cflags and ldflags.

Also removes linking crypto and ssl on OpenBSD/NetBSD since it's not
needed there for the vm itself. Also make sure to pass down cflags and
ldflags properly to extension building.