Plea deal will end nearly 40-year-old murder case