The poorer nations of Europe benefited for years from compensation funds -- money given by the rich countries to be spent on roads , electricity grids , modernized farms and factories -- that enabled countries like Ireland , Spain and Greece to join the 20th century .