Unfortunately I only tested the kevent stuff on FreeBSD 12. FreeBSD < 12 has an older clang, which seems to add less headers automatically.
The call to check_include_file(sys/event.h) fails as it's missing sys/types.h.
So change this to check_include_files(sys/types.h;sys/event.h).