Fix curl/wget detection. Fixes #478