Fix build on NetBSD