US to work with Pakistan against terrorism