Added ioctl stuff

- added ioctl code to test application
- small changes Makefile