Only add -lpcap when linking files that actually need it. Closes #604.