configure: fix some bsd issues