Portability

- Fixed cmake issues on NetBSD (thanks to atomicules).