Presidential election recount efforts in Pennsylvania and Wisconsin came to an end on Monday, with both states certifying Donald J. Trump as the winner in contests that helped put him over the top in the Electoral College tally.