Fixed use of otemplate and tempalte tags on freebsd. Needed special linker flag. Also fixed compile with libev library.