diff --git a/unix/Makefile b/unix/Makefile
index e65338f..e169edf 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -1,5 +1,5 @@
 # Edited for Debian GNU/Linux.
-DESTDIR =
+DESTDIR = @TERMUX_PREFIX@
 
 # DEBIAN NOTE: This file diverges significantly from the original Makefile
 #   for obvious reasons.  The original Makefile is Makefile.unix and should
@@ -16,9 +16,9 @@ DESTDIR =
 # Edited for Debian GNU/Linux: LIBVARDIR is where the score file is kept
 # OWNER is who you want the game to be chown to.
 # GROUP is who you wnat the game to be chgrp to.
-BINDIR = $(DESTDIR)/usr/games
+BINDIR = $(DESTDIR)/bin
 ETCDIR = $(DESTDIR)/etc
-LIBSTATICDIR = $(DESTDIR)/usr/lib/games/moria
+LIBSTATICDIR = $(DESTDIR)/lib/games/moria
 LIBVARDIR = $(DESTDIR)/var/games/moria
 OWNER = root
 GROUP = games
@@ -26,7 +26,7 @@ GROUP = games
 # For testing and debugging the program, it is best to use this line.
 # CFLAGS = -g
 # For playing the game, you may want to use this line
-CFLAGS = -O2
+CFLAGS += -O2
 
 # Debian GNU/Linux addition
 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
@@ -36,7 +36,7 @@ endif
 # For BSD Systems
 # CURSES = -lcurses -ltermcap
 # For SYS V Systems
-CURSES = -lcurses
+CURSES = -lncurses 
 # For XENIX, some XENIX systems may need -ltinfo
 # CURSES = -ltcap -ltermcap -lx
 
@@ -44,9 +44,9 @@ CURSES = -lcurses
 # config.h if you use this.
 #LFLAGS = -lbsd
 # Normal systems don't require anything here.
-LFLAGS = 
+LFLAGS ?= 
 
-CC = cc
+CC ?= cc
 
 SRCS = main.c misc1.c misc2.c misc3.c misc4.c store1.c files.c io.c \
 	create.c desc.c generate.c sets.c dungeon.c creature.c death.c \
@@ -66,7 +66,7 @@ LIBSTATICFILES = news origcmds.hlp owizcmds.hlp roglcmds.hlp rwizcmds.hlp \
 	version.hlp welcome.hlp
 
 moria : $(OBJS)
-	$(CC) -o moria $(CFLAGS) $(OBJS) $(CURSES) $(LFLAGS)
+	$(CC) -o moria $(CFLAGS) $(LDFLAGS) $(OBJS) $(CURSES) $(LFLAGS)
 
 lintout : $(SRCS)
 	lint $(SRCS) $(CURSES) > lintout
@@ -80,21 +80,16 @@ TAGS : $(SRCS)
 # you must define BINDIR and LIBDIR before installing
 # assumes that BINDIR and LIBDIR exist
 install:
-	chmod 755 $(BINDIR)
 	cp moria $(BINDIR)
-	chown $(OWNER) $(BINDIR)/moria
-	chgrp $(GROUP) $(BINDIR)/moria
 	chmod 2755 $(BINDIR)/moria
+	mkdir -p $(LIBSTATICDIR)
 	chmod 755 $(LIBSTATICDIR)
 	# No longer chmod 755 $(LIBVARDIR)
 	(cd files; cp $(LIBSTATICFILES) $(LIBSTATICDIR))
-	(cd $(LIBSTATICDIR); chmod 444 $(LIBSTATICFILES))
 	# No longer (cd $(LIBVARDIR); touch scores; chmod 664 scores)
 	# No longer (cd $(LIBVARDIR); chown $(OWNER) . scores; chgrp $(GROUP) . scores)
 	(cd files; cp hours $(ETCDIR)/moria-hours)
 	chmod 644 $(ETCDIR)/moria-hours
-	(cd $(LIBSTATICDIR); chown $(OWNER) $(LIBSTATICFILES))
-	(cd $(LIBSTATICDIR); chgrp $(GROUP) $(LIBSTATICFILES))
 # If you are short on disk space, or aren't interested in debugging moria.
 	# This is handled by dh_strip, so let's not override its' decision.
 	# strip $(BINDIR)/moria