Pakistan and Afghanistan to jointly counter terror threats as their ties improve