You need to add legend.title=element_blank() to the theme to remove the title of the legend.
Change your code as follows:
p1 <- ggplot(ndf, aes(x=xvals, y=yvals, fill = category, colour = category)) +
geom_line() +
scale_color_manual(values = c('black', 'red', 'blue', '#4DAC26')) +
labs(x = "class probability",
y = "pdf"
) +
theme_bw() +
theme(legend.position = c(.99, .99), legend.title=element_blank())