build: improve pcap dependency handling