Greece, Macedonia ink deal to end name row