Lakers agree to deal with top remaining free agent