Every website that I look at has a different explanation and none of them seem to help me get this utility installed. Here are the best instructions I found and what went wrong. They are from the kali linux webpage on how to install on Debian.

git clone https://github.com/charlesxsh/mdk3-master.git

cd mdk3-master
sudo make install
sudo /usr/local/sbin/mdk3

When I type make I get: make: *** No rule to make target 'osdep/libosdep.a', needed by 'mdk3'. Stop.

I have tried as root aswell as non-root using sudo. Any help would be appreciated I have spent a fair amount of time on this.

1 Answer 1


As a general practice, it is good if you use original sources (author's repositories). The github link you provided isn't the original link. After much googling I couldn't find the original link, the author's web page seems to be down (Here is the web-archive link). I then looked for mdk3 in Kali Linux's repositories (Kali Linux is successor to backtrack). Since Kali Linux is a well known Linux distribution, its repositories can be trusted.

The following steps worked for me.

git clone git://git.kali.org/packages/mdk3.git
patch <makefile.patch #<patch the source to get rid of "undefined reference to pthread_create" while doing make
make install

Contents of the patch file, makefile.patch are the following.

diff --git a/Makefile b/Makefile
index 20182a2..e6f5739 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CFLAGS     = -g -O3 -Wall -Wextra
+CFLAGS     = -g -O3 -Wall -Wextra -pthread
 LINKFLAGS  = -lpthread

 DESTDIR        =

I had to patch the Makefile to get rid of "undefined reference to `pthread_create'" error which I was getting while doing make. The patch simply adds -pthread in CLFAGS.
I am using Ubuntu 15.10 (64-bit), but I have tested it on Linux Mint 18 (64-bit) as well (using live disk).

I have uploaded the patch file, and the mdk3 repository to github (So that I can use https:// instead of git:// for cloning, since the port for git protocol is blocked by university firewall). Here is the link. The Makefile in this repository is already patched.

  • patch <makefile.patch < #patch the source to get rid of "undefined reference to pthread_create" while doing make parse error near `\n'
    – Aaron Esau
    Jan 24, 2017 at 6:42
  • 1
    I have updated that line slightly. The second < shouldn't be there. Jan 26, 2017 at 9:24
  • 1
    Did the change work for you? Jan 26, 2017 at 11:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .