cgit.mk: Do not link against libdl on *BSD

*BSD includes dlsym() in libc and does not have libdl. Add a check in
the Makefile to handle this.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Refactor cgit_new_filter()

Use prefixcmp() as a preparation for using strip_prefix() later. Also,
interpret the command as a file name if it contains a colon but none of
the filter prefixes matches instead of bailing out and adding a special
check for Windows.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>