If the signal strength obtained from sonar is higher than the predefined detection threshold, it is considered as a candidate for target tracking. This detection threshold is a parameter that affects the detection probability of targets and the distribution of clutter measurements, so it is important to determine a proper threshold to improve target tracking performance. There are various techniques for adjusting the detection threshold. To apply these techniques, it is assumed that the probability density functions of the signal strength for clutter are known in advance. However, in a real environment, the probability density function of the signal strength is unknown in general. In this paper, we propose a detection threshold control method using extremum seeking control in realistic environments. The extremum seeking control is a method used in complex nonlinear systems. We propose a new structure for extremum seeking control that is applicable to detection processes with nonlinear characteristics. This structure is used to adjust the detection threshold of the received signal amplitude to make the estimated clutter measurement density converge to a designed clutter measurement density to achieve the best target tracking performance in the current environment. Simulation studies for the proposed extremum seeking control applied to target tracking in an unknown clutter signal distribution demonstrate the effectiveness and improved target tracking performance.