Gunmen have killed at least 17 farmers and wounded about 13 others in northwestern Nigeria.