fix curl compile (based on patch by Ambroz Bizjak)