Hamas PM says referendum illegal