How to resolve the "/lib/modules/3.13.0-27-generic/build: No such file or directory" error message?

you need to install linux-headers-3.13.0-27-generic package

sudo apt-get install linux-headers-3.13.0-27-generic

or better

sudo apt-get install linux-headers-`uname -r`

this will provide the link /lib/modules/3.13.0-27-generic/build


Find where your build-essentials are kept

find / | grep include/generated/autoconf.h

Mine returned

/usr/src/linux-headers-4.19.0-5-amd64/include/generated/autoconf.h

If you followed the guides online and they didn't work, replace

/lib/modules/`uname -r`/build

With the result from above - in my case

/usr/src/linux-headers-`uname -r`

So, in total

obj-m += hello-1.o

all:
    make -C /usr/src/linux-headers-$(shell uname -r) M=$(PWD) modules

clean:
    make -C /usr/src/linux-headers-$(shell uname -r) M=$(PWD) clean