make: *** [modules] Error 2 when trying to install rtl8723de driver

First, remove the inoperable files:

sudo rm -r rtl8723de*

Next, install another prerequisite:

sudo apt update && sudo apt -y install git

Now clone a better file:

git clone https://github.com/lwfinger/rtlwifi_new.git

Now build the driver:

cd rtlwifi_new
make
sudo make install
sudo modprobe rtl8723de

Your wireless should now be working.

EDIT: When Update Manager installs a newer kernel version, also known as linux-image, after the requested reboot, recompile:

cd ~/rtlwifi_new
make clean
git pull
make
sudo make install
sudo modprobe rtl8723de