Formation of comet 67P/Churyumov-Gerasimenko through gravitational collapse of a clump of pebbles