The Ford Motor Co. on Thursday posted a second-quarter loss of $8.7 billion, due mostly to the declining value of its SUV and pickup truck lines, and announced a plan to overhaul its North American production to focus on small…