Directly build external components inside libpkg

That fixes arm and ia64 problems
Fix usage of getline
Fix more gcc warnings
Fix pkg add allowing to install package with missing dependencies