President-elect Obama, McCain vow to work closely