Each military coup is illegitimate, Turkish PM says