Is there a reason why you're using lm.gls() instead of gls() in the nlme package?
I'm not on my computer, so I apologize for the lack of reprex, but,
set.seed(123)
y <- runif(5)
x <- 1:5
fit <- nlme::gls(y ~ x)
fit_sum <- summary(fit)
fit_sum[["tTable"]]
You should be able to extract what you need from there.