Add missing dependencies on pthread (sqlite being built with threadsafety on)
Update sqlite3 to 3.8.7.2